package com.gym.openapi.web.controller;

import com.gym.openapi.common.ResponseResult;
import com.gym.openapi.common.ResultTable;
import com.gym.openapi.entity.AppInfo;
import com.gym.openapi.services.AppInfoServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ming
 * 2021/11/26
 * description:应用管理
 */
@RestController
@RequestMapping("/appInfo")
public class AppInfoController {
    @Autowired
    private AppInfoServices as;

    /**
     *@author:ming
     *@Date: 2021/11/27
     *@description:页面显示 搜索栏搜索
     */
    @RequestMapping("/table")
    public ResultTable appTable(Integer page, Integer limit, String corpName) {
        ResultTable rt = as.appTable(page, limit, corpName);
//        System.out.println("rt"+rt);
        return rt;
    }
    /**
     *@author:ming
     *@Date: 2021/11/27
     *@description:批量删除
     */
    @RequestMapping("/del")
    public ResponseResult del(Integer[] ids) {
        return as.del(ids);
    }

    /**
     * @author:ming
     * @Date: 2021/11/27
     * @description:编辑修改信息
     */
    @RequestMapping("/update")
    public ResponseResult update(AppInfo appInfo) {
        return as.update(appInfo);
    }

    /**
     * @author:ming
     * @Date: 2021/11/27
     * @description:添加数据
     */
    @RequestMapping("/add")
    public ResponseResult add(AppInfo appInfo) {
        System.out.println("appimfo"+appInfo);
        return as.add(appInfo);
    }
}
